Xbasic
NodeServices::TimeBasedTokenCheckToken Method
Syntax
L CheckToken(C key, C token)
Arguments
- keyCharacter
The secret key used to create the token. The secret passed to the function should be 16 characters in length if you plan to use the Google Authenticator application.
- tokenCharacter
The token to validate.
Returns
- resultLogical
Returns .f. if the token is not valid. Otherwise, returns .t..
Description
Check validity of token
Discussion
The NodeServices::TimeBasedToken CheckToken() method validates a token given a secret key. Time based tokens are often used with an application such as Google Authenticator for two-factor authentication.
'validate a time based token 'NOTE: in many cases the user will use an App like Google Authenticator 'to generate the token dim tbt as nodeservices::timebasedtoken dim secret as c secret = "abcdefghijklmnop" dim token as c token = "123456" dim flagValid as l flagValid = tbt.CheckToken(secret,token)